const Router = require('koa-router');
const router = new Router();
const tool = require('../../tools/tool')
const {db, QueryTypes} = require("../../models/db");

router.post('/print/billPrintSuc', async ctx => {
    let tenantId = ctx.user.tenantId;
    let cargoId = ctx.request.body.cargoId;
    let cargo = await db.models['cargo'].findOne({
        where: {
            id: cargoId,
            tenantId
        }
    })
    cargoId.printNo = cargo.printNo ? cargo.printNo : 0;
    await cargo.save()
    return ctx.suc('');
})

module.exports = router;
